package com.fdd.op.sdk.request.api.file;

import com.fdd.op.sdk.ApiRuleException;
import com.fdd.op.sdk.BaseFddRequest;
import com.fdd.op.sdk.FddUploadRequest;
import com.fdd.op.sdk.FileItem;
import com.fdd.op.sdk.constants.Constants;
import com.fdd.op.sdk.internal.mapping.RequestField;
import com.fdd.op.sdk.internal.util.StringUtils;
import com.fdd.op.sdk.model.vo.WidgetValueVo;
import com.fdd.op.sdk.response.api.file.CreateFileResponse;
import com.fdd.op.sdk.response.api.file.UploadResponse;

import java.io.File;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class CreateFileRequest extends BaseFddRequest<CreateFileResponse> {
    @Override
    public String getApiMethodName() {
        return "/base/api/template/createFile";
    }

    @Override
    public Map<String, Object> getTextParams() {
        return null;
    }

    @Override
    public Class<CreateFileResponse> getResponseClass() {
        return CreateFileResponse.class;
    }

    @Override
    public void check() throws ApiRuleException {
        if(StringUtils.isBlank(getTemplateNo())){
            throw new ApiRuleException("4000", "缺少必要的请求参数: templateNo");
        }
    }

    @Override
    public String getHttpMethod() {
        return Constants.METHOD_POST;
    }

    @RequestField("模板在当前系统的唯一标识")
    private String templateNo;

    @RequestField("模板控件值列表")
    private List<WidgetValueVo> widgetValues;

    public String getTemplateNo() {
        return templateNo;
    }

    public void setTemplateNo(String templateNo) {
        this.templateNo = templateNo;
    }

    public List<WidgetValueVo> getWidgetValues() {
        return widgetValues;
    }

    public void setWidgetValues(List<WidgetValueVo> widgetValues) {
        this.widgetValues = widgetValues;
    }
}
